/*
 * lora.h
 *ra-08h
 *  Created on: Jul 14, 2024
 *      Author: yuxuan
 */

#ifndef LORA_H_
#define LORA_H_
#include <stdint.h>
#include "main.h"
#include "usart.h"
#include "top_scheme.h"
#include "tim.h"
#include "stm32f4xx_it.h"

//#include "sys.h"

//设备参数定义
typedef struct
{
	//接受和发送的参数
	unsigned int Air_rate;		//空中速率
	uint8_t pwr;				//发射功率
	uint8_t output_power;		//发射频率
	uint8_t recive_power;		//接收频率
	uint8_t local_addr;			//定点传输地址

}_LoRa_CFG;

//设备默认参数
#define LoRa_Air_rate   	2400 //空中速率
#define	LoRa_pwr         	23   //发射功率
#define LoRa_output_power 	23   //发射频率
#define LoRa_recive_power 	21   //接收频率
#define LoRa_local_addr   	0    //定点传输地址



extern _LoRa_CFG LoRa_CFG;

void LoRa_configuration(void);  //loRa配置函数
void LoRa_send(void);			//发送采集数据指令函数
void lora_receivedata_CRC(uint8_t *rx_data,uint8_t len);////数据CRC校验并将收到的数据发回网关
void QS96_clean(void);
void QS96_getdata(void);

extern uint8_t QS96_collect_step;

#endif /* LORA_H_ */
